﻿@model ShippingSettingsModel
@{
    //page title
    ViewBag.Title = T("Admin.Configuration.Settings.Shipping").Text;
}
@using (Html.BeginForm())
{    
    <script type="text/javascript">
        $(document).ready(function () {
            $("#@Html.FieldIdFor(model => model.FreeShippingOverXEnabled)").click(toggleFreeShippingOverX);

        toggleFreeShippingOverX();
    });

    function toggleFreeShippingOverX() {
        if ($('#@Html.FieldIdFor(model => model.FreeShippingOverXEnabled)').is(':checked')) {
            $('#pnlValueOfX').show();
            $('#pnlValueOfXincltax').show();
        }
        else {
            $('#pnlValueOfX').hide();
            $('#pnlValueOfXincltax').hide();
        }
    }

    </script>
    
    <div class="section-header">
        <div class="title">
            <img src="@Url.Content("~/Administration/Content/images/ico-configuration.png")" alt="" />
            @T("Admin.Configuration.Settings.Shipping")
        </div>
        <div class="options">
            <input type="submit" name="save" class="k-button" value="@T("Admin.Common.Save")" />
        </div>
    </div>
    @Html.Action("StoreScopeConfiguration", "Setting")
    @Html.ValidationSummary(false)
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                @Html.OverrideStoreCheckboxFor(model => model.AllowPickUpInStore_OverrideForStore, model => model.AllowPickUpInStore, Model.ActiveStoreScopeConfiguration)
                @Html.NopLabelFor(model => model.AllowPickUpInStore):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.AllowPickUpInStore)
                @Html.ValidationMessageFor(model => model.AllowPickUpInStore)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.OverrideStoreCheckboxFor(model => model.UseWarehouseLocation_OverrideForStore, model => model.UseWarehouseLocation, Model.ActiveStoreScopeConfiguration)
                @Html.NopLabelFor(model => model.UseWarehouseLocation):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.UseWarehouseLocation)
                @Html.ValidationMessageFor(model => model.UseWarehouseLocation)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.OverrideStoreCheckboxFor(model => model.FreeShippingOverXEnabled_OverrideForStore, model => model.FreeShippingOverXEnabled, Model.ActiveStoreScopeConfiguration)
                @Html.NopLabelFor(model => model.FreeShippingOverXEnabled):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.FreeShippingOverXEnabled)
                @Html.ValidationMessageFor(model => model.FreeShippingOverXEnabled)
            </td>
        </tr>
        <tr id="pnlValueOfX">
            <td class="adminTitle">
                @Html.OverrideStoreCheckboxFor(model => model.FreeShippingOverXValue_OverrideForStore, model => model.FreeShippingOverXValue, Model.ActiveStoreScopeConfiguration)
                @Html.NopLabelFor(model => model.FreeShippingOverXValue):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.FreeShippingOverXValue)
                @Html.ValidationMessageFor(model => model.FreeShippingOverXValue)
            </td>
        </tr>
        <tr id="pnlValueOfXincltax">
            <td class="adminTitle">
                @Html.OverrideStoreCheckboxFor(model => model.FreeShippingOverXIncludingTax_OverrideForStore, model => model.FreeShippingOverXIncludingTax, Model.ActiveStoreScopeConfiguration)
                @Html.NopLabelFor(model => model.FreeShippingOverXIncludingTax):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.FreeShippingOverXIncludingTax)
                @Html.ValidationMessageFor(model => model.FreeShippingOverXIncludingTax)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.OverrideStoreCheckboxFor(model => model.EstimateShippingEnabled_OverrideForStore, model => model.EstimateShippingEnabled, Model.ActiveStoreScopeConfiguration)
                @Html.NopLabelFor(model => model.EstimateShippingEnabled):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.EstimateShippingEnabled)
                @Html.ValidationMessageFor(model => model.EstimateShippingEnabled)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.OverrideStoreCheckboxFor(model => model.DisplayShipmentEventsToCustomers_OverrideForStore, model => model.DisplayShipmentEventsToCustomers, Model.ActiveStoreScopeConfiguration)
                @Html.NopLabelFor(model => model.DisplayShipmentEventsToCustomers):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.DisplayShipmentEventsToCustomers)
                @Html.ValidationMessageFor(model => model.DisplayShipmentEventsToCustomers)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.OverrideStoreCheckboxFor(model => model.DisplayShipmentEventsToStoreOwner_OverrideForStore, model => model.DisplayShipmentEventsToStoreOwner, Model.ActiveStoreScopeConfiguration)
                @Html.NopLabelFor(model => model.DisplayShipmentEventsToStoreOwner):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.DisplayShipmentEventsToStoreOwner)
                @Html.ValidationMessageFor(model => model.DisplayShipmentEventsToStoreOwner)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.OverrideStoreCheckboxFor(model => model.BypassShippingMethodSelectionIfOnlyOne_OverrideForStore, model => model.BypassShippingMethodSelectionIfOnlyOne, Model.ActiveStoreScopeConfiguration)
                @Html.NopLabelFor(model => model.BypassShippingMethodSelectionIfOnlyOne):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.BypassShippingMethodSelectionIfOnlyOne)
                @Html.ValidationMessageFor(model => model.BypassShippingMethodSelectionIfOnlyOne)
            </td>
        </tr>
        <tr>
            <td class="adminTitle" colspan="2">
                @Html.OverrideStoreCheckboxFor(model => model.ShippingOriginAddress_OverrideForStore, "pnlShippingOriginAddress", Model.ActiveStoreScopeConfiguration)
                <strong>@Html.LabelFor(model => model.ShippingOriginAddress):</strong>
            </td>
        </tr>
        <tr id="pnlShippingOriginAddress">
            <td colspan="2">
                @Html.EditorFor(x => x.ShippingOriginAddress, "Address")
            </td>
        </tr>
    </table>
}